---
title: "SQL-022: Get policy periods"
summary: Retrieve policy periods for a policy number.
status: draft
owner: SAIF Corporation
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# SQL-022 Get policy periods

This stored procedure call retrieves policy periods for a policy so the library can populate current, renewal, and historical period information.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-022 |
| **Operation type** | Read |
| **Execution method** | StoredProc |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | StoredProcedure |
| **Business object** | `clsPolicyPeriodCollection` |
| **Criteria property** | `RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:apolicynum` | Input | Decimal | N/A | Policy number whose policy periods are requested. |
| `:aTopNPolPer` | Input | Decimal | N/A | Maximum number of policy periods to return. |
| `recordset` | Output (Cursor) | REF CURSOR | N/A | Result set containing policy period rows. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| N/A — Stored procedure | SELECT | Procedure body resides in the database. |

## Sample SQL

```sql
-- Oracle stored procedure call (CommandType.StoredProcedure)
-- clsPolicyPeriodCollection.BeforeRetrieve
CALL pk72846_view_policy.getPolicyPeriods(
  :apolicynum,
  :aTopNPolPer,
  :recordset)
```

> The procedure body resides in the Oracle database; it was not retrievable for this run.

## Operations and processes
- [Retrieve policy periods](../operations-processes.md)

## Business rules
- [BR-VP-018: Current/renewal period selection](../business-rules.md#br-vp-018-currentrenewal-period-selection)
- [BR-VP-019: Latest printed information-page period](../business-rules.md#br-vp-019-latest-printed-information-page-period)

## Sources
- `SAIF.Business.View.Policy/clsPolicyPeriodCollection.vb`
